<?php
include(CHEMIN_MODELE."verifEtudiantFicheForum.php");
$i= 0;
if(isset($_POST["Accueil"]) && isset($_POST["Emplacement"])
		&& isset($_POST["Circulation"]) && isset($_POST["Frequentation"])
		&& isset($_POST["Interet"]) && isset($_POST["Commentaire"]))
{
	if(!empty($_POST["Accueil"]))
	{
		$accueil = $_POST["Accueil"];
		if(!empty($_POST["Emplacement"]))
		{
			$emplacement = $_POST["Emplacement"];
			if(!empty($_POST["Circulation"]))
			{
				$circulation = $_POST["Circulation"];
				if(!empty($_POST["Frequentation"]))
				{
					$frequentation = $_POST["Frequentation"];
					if(!empty($_POST["Interet"]))
					{
						$interet = $_POST["Interet"];
						if(!empty($_POST["Aucun"]) && $_POST["Aucun"]==1)
						{
							echo"aucun";
						}
						else
						{
							verifEtudiantFicheForum(1, $i);
							verifEtudiantFicheForum(2, $i);
						}
						
					}	
					else
					{
						$_SESSION["erreur"][$i]="Champ intérêt vide";
						$i++;
					}
				}
				else
				{
					$_SESSION["erreur"][$i]="Champ fréquentation vide";
					$i++;
				}
			}
			else
			{
				$_SESSION["erreur"][$i]="Champ circulation vide";
				$i++;
			}
		}
		else
		{
			$_SESSION["erreur"][$i]="Champ emplacement vide";
			$i++;
		}
	}
	else
	{
		$_SESSION["erreur"][$i]="Champ accueil vide";
	}
}
//print_r($_SESSION["erreur"]);
if(isset($_SESSION["erreur"]))
{
	echo "Des erreurs sont survenues !";
	echo '<form method="post" action="index.php?module=actionComm&action=remplirFormulaireForum">
	<p>
		<input type="hidden" name="Acceuil" value="'.$_POST["Accueil"].'" />
	</p>
	<p>
		<input type="hidden" name="Emplacement" value="'.$_POST["Emplacement"].'" />
	</p>
	<p>
		<input type="hidden" name="Circulation" value="'.$_POST["Circulation"].'" />
	</p>
	<p>
		<input type="hidden" name="Frequentation" value="'.$_POST["Frequentation"].'" />
	</p>
	<p>
		<input type="hidden" name="Interet" value="'.$_POST["Interet"].'" />
	</p>
	<p>
		<input type="hidden" name="Commentaire" value="'.$_POST["Commentaire"].'" />
	</p>
	<p>
		<input type="submit" name="corriger" value="Retour au formulaire"/>
	</p>
	</form>';
}
/*else
	header("Location: index.php?module=actionComm&action=generation");*/